#ifndef LOGOPAINTER_H
#define LOGOPAINTER_H

#include <QWidget>

#include <QPen>
#include <QBrush>
#include <QPaintEvent>
#include <QPixmap>
#include <QPainter>

#include "Commands.h"

class LogoPainter : public QWidget
{
    Q_OBJECT
public:
    explicit LogoPainter(QWidget *parent = 0);

signals:

public slots:

    void paraFrente(int steps);
    void paraTras(int steps);
    void girarDireita(int angulo);
    void girarEsquerda(int angulo);
    void pular(int steps);
    void forca(int forca);
    void limpar();
    void mudarCor(QColor cor);

    void desenhaTudo(bool stepByStep);

private slots:
    void _runCommand(QPainter *painter, Command *command);
    void _nextStep();

protected:
    void _walk(int steps, int direction);
    void _rotate(int angle);

    void paintEvent(QPaintEvent *event);

private:

    QBrush _brush;
    QPen _pen;

    QList<Command *> _listCmds;
    int _curStep = -1;

    QPixmap _picTurtle;

};

#endif // LOGOPAINTER_H
